import {FormProps, FormSchema} from '/@/components/Table';

import {BasicColumn} from '/@/components/Table/src/types/table';
import {uploadApi} from '/@/api/sys/upload';
import {Tinymce} from '/@/components/Tinymce/index';
import {h} from 'vue';


//表格显示列
export function getBasicColumns(): BasicColumn[] {
  // @ts-ignore
  return [
    {
      title: 'ID',
      dataIndex: 'aboutUsId',
      fixed: 'left',
      width: 100,
    },


  ];
}

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 150,
    baseColProps: {lg: 6, md: 24},
    schemas: formParamSchema,
  };
}


//编辑表单
export const formParamSchema: FormSchema[] = [

];

//编辑表单
export const formSchema: FormSchema[] = [
  {
    field: 'juxianStory',
    label: '协会简介',
    component: 'InputTextArea',
    defaultValue: '',
    componentProps: {
      autoSize: {
        minRows: 10, maxRows: 30
      }
    }
    /*rules: [{required: true}],
    render: ({model, field}) => {
      return h(Tinymce, {
        value: model[field],
        onChange: (value: string) => {
          model[field] = value;
        },
      });
    },*/
  },
  {
    field: 'schoolEnv',
    label: '宣传视频底图',
    component: 'Upload',
    componentProps: {
      api: uploadApi,
      accept: ['jpg', 'png', 'jpeg'],
      maxNumber: 2,
      maxSize: 1,
      helpText: '请上传png/jpg 等图片文件，文件大小小于1M',
    },
  },
  {
    field: 'schoolGlory',
    label: '宣传视频',
    component: 'Upload',
    componentProps: {
      api: uploadApi,
      accept: ['mp4'],
      maxNumber: 2,
      maxSize: 10,
      helpText: '请上传mp4文件，文件大小小于10M',
    },
  }
];
